### Copyright (C) 2010 Desmond Carter
###
### This file is part of Ar.
###
### Ar is free software: you can redistribute it and/or modify it under the
### terms of the GNU General Public License as published by the Free Software
### Foundation, either version 3 of the License, or (at your option) any later
### version.
###
### Ar is distributed in the hope that it will be useful, but WITHOUT ANY
### WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
### FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
### details.
###
### You should have received a copy of the GNU General Public License along
### with Ar. If not, see <http://www.gnu.org/licenses/>.

## This file handles the main game loop. It is the only one that actually runs
## code.


import pygame, ar
from ar.locals import *



if __name__ == '__main__':
    ar.screen = pygame.display.set_mode((width, height))

    # As far as I can tell, this is not being executed correctly
    # I think fixing the problem here will get it to draw again
    ar.drawtools.doboth(ar.board.draw, origin=ar.origin, screen=ar.screen,
                        drawn_dimensions=ar.drawn_dimensions)

    ar.drawn_dimensions = [0, 1, 2]
    ar.board2screencount = 0 # Debugging aid; tracks invocations of functions

    loop = True
    while loop: # i/o loop--this appears to be working
        ar.pygame.display.flip()
        loop = ar.io.handle_input(ar.screen)
